<template>
  <div>
    <line-marker :chart-data="chartData" :height="chartHeight"></line-marker>
  </div>
</template>

<script>
  import LineMarker from '../../../components/Charts/LineMarker'

  export default {
    name: 'Line',
    components: {LineMarker},
    data() {
      return {
        info: null,
        chartHeight: '100px',
        chartData: {
          title: '资讯日营收',
          xAxis: ['13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55'],
          items:
            [
              {
                name: '联通',
                dataList: [220, 182, 191, 134, 150, 120, 180, 125, 145, 122, 165, 122]
              },
              {
                name: '移动',
                dataList: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
              },
              {
                name: '电信',
                dataList: [210, 182, 125, 145, 122, 191, 134, 150, 120, 110, 165, 122]
              },
              {
                name: '宝讯',
                dataList: [105, 134, 147, 167, 186, 122, 132, 174, 126, 111, 171, 176]
              },
              {
                name: '华讯',
                dataList: [160, 144, 167, 122, 134, 111, 189, 175, 147, 180, 148, 199]
              },
              {
                name: '菲讯',
                dataList: [184, 168, 112, 46, 111, 178, 176, 123, 181, 189, 140, 122]
              }
            ]
        }
      }
    },
    created() {
      const h = window.innerHeight;
      this.chartHeight = (h - 50) + 'px';
    },
    methods: {
      handleClick(message) {
        this.$message(message);
      },
      showInfo(info) {
        this.$alert(info, '提示', {
          confirmButtonText: '确定',
          callback: action => {
            this.$message({
              type: 'info',
              message: `action: ${action}`
            });
          }
        });
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .chart-container {
    position: relative;
    width: 100%;
    height: 100vh;
    /*height: calc(100vh - 84px);*/
  }
</style>
